import Vue from 'vue'
import VueRouter from 'vue-router'
import LayoutView from '../views/LayoutView.vue'
import HomeView from '../views/HomeView.vue'
// component: () => import(/* webpackChunkName: "about" */ '../views/AboutView.vue')
Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    component: LayoutView,
    children: [
      {
        path: '',
        name: 'home',
        component: HomeView
      },
      {
        path: 'movie',
        name: 'movie',
        component: () => import(/* webpackChunkName: "movie" */ '../views/MovieView.vue')
      },
      {
        path: 'cinima',
        name: 'cinima',
        component: () => import(/* webpackChunkName: "cinima" */ '../views/CinimaView.vue')
      },
      {
        path: 'mine',
        name: 'mine',
        component: () => import(/* webpackChunkName: "mine" */ '../views/MineView.vue')
      }
    ]
  },
  {
    path: '/login',
    name: 'login',
    component: () => import(/* webpackChunkName: "login" */ '../views/LoginView.vue')
  },
  {
    path: '/detail/:id',
    name: 'detail',
    component: () => import(/* webpackChunkName: "detail" */ '../views/DetailView.vue')
  },
  {
    path: '/search',
    name: 'search',
    component: () => import(/* webpackChunkName: "search" */ '../views/SearchView.vue')
  }
]

const router = new VueRouter({
  routes
})

export default router
